<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 7/12/17
 * Time: 10:50 AM
 */
declare(strict_types=1);


namespace application\service\library\socket;

/**
 * Class Passport
 *
 * @property string $id
 * @property string $name
 *
 * @package application\service\library\socket
 */
class Passport
{
    protected $data = [];

    /**
     * Passport constructor.
     * @param string $id
     * @param string $pwd
     * @throws
     */
    public function __construct(string $id, string $pwd = '')
    {
        $this->data['id'] = $id;
        $this->data['pwd'] = $pwd;
        # TODO:验证password
    }

    public function __get($name)
    {
        return $this->data[$name]??null;
    }

    public function __set($name, $value)
    {
        $this->data[$name] = $value;
    }
}